package com.cmcc.passenger.data.entity.response
import android.os.Parcel
import android.os.Parcelable
import com.cmcc.passenger.data.entity.OptionItem
import com.google.gson.annotations.SerializedName


/**
 * Author: jiangxin
 * Date: 2019/11/14
 * Description:
 */
data class CarCategory(
    @SerializedName("id")
    override var id: String?,
    @SerializedName("kilometreFee")
    val kilometreFee: Double,
    @SerializedName("minuteFee")
    val minuteFee: Double,
    @SerializedName("name")
    override var name: String?,
    @SerializedName("iconFilePath")//司机端使用
    val iconFilePath: String?,
    @SerializedName("navigationIconFilePath")//乘客端使用
    val navigationIconFilePath:String?,
    @SerializedName("code")
    var code: String?,
    //非后台返回，用于映射ID
    var customerId: Int
) : OptionItem, Parcelable {
    constructor(parcel: Parcel) : this(
        parcel.readString(),
        parcel.readDouble(),
        parcel.readDouble(),
        parcel.readString(),
        parcel.readString(),
        parcel.readString(),
        parcel.readString(),
        parcel.readInt()
    )

    override fun writeToParcel(parcel: Parcel, flags: Int) {
        parcel.writeString(id)
        parcel.writeDouble(kilometreFee)
        parcel.writeDouble(minuteFee)
        parcel.writeString(name)
        parcel.writeString(iconFilePath)
        parcel.writeString(navigationIconFilePath)
        parcel.writeString(code)
    }

    override fun describeContents(): Int {
        return 0
    }

    companion object CREATOR : Parcelable.Creator<CarCategory> {
        override fun createFromParcel(parcel: Parcel): CarCategory {
            return CarCategory(parcel)
        }

        override fun newArray(size: Int): Array<CarCategory?> {
            return arrayOfNulls(size)
        }
    }
}